import request from '@/util/request'
import { dealOpts, COURSE } from './../api_type'

// COURSE
const courseGetDetail = (params, opts) => {
  return request.get(dealOpts(COURSE + '/getMine', opts), params)
}

const courseModifyInfo = (params, opts) => {
  return request.post(dealOpts(COURSE + '/modify', opts), params)
}

const courseCreateInfo = (params, opts) => {
  return request.post(dealOpts(COURSE + '/create', opts), params)
}

const courseGetInfo = (params, opts) => {
  return request.post(dealOpts(COURSE + '/getMine', opts), params)
}

const courseGetMines = (params, opts) => {
  return request.get(dealOpts(COURSE + '/getMines', opts), params)
}

const courseGetSingleOrders = (params, opts) => {
  return request.get(dealOpts(COURSE + '/getSingleOrders', opts), params)
}

export default {
  courseGetDetail,
  courseModifyInfo,
  courseCreateInfo,
  courseGetInfo,
  courseGetMines,
  courseGetSingleOrders
}
